//////////////////////////////////////
// Fast Container Library           //
// MIT License - Copyright (c) 2012 //
//////////////////////////////////////

#pragma once

#include "static_vector.h"

FC_NAMESPACE_BEGIN


template <class T, size_t N, class Container>
class static_stack
{
public:
	typedef stack<T, Container>						this_type;
	typedef Container								container_type;
	typedef typename Container::value_type			value_type;
	typedef typename Container::size_type			size_type;
	typedef typename Container::pointer				pointer;
	typedef typename Container::const_pointer		const_pointer;

	static_stack() : c()
		{
		}

	explicit static_stack( const Container& container )
		: c(container)
		{
		}

	static_stack& operator =( const this_type& x )
	{
		if( &x != this )
			c = x.c;

		return *this;
	}

	void push( const value_type& value ) { c.push_back(value); }
	void pop() { c.pop_back(); }

	void clear() { c.clear(); }

	value_type& top() { return c.back(); }
	const value_type& top() const { return c.back(); }

	bool empty() const { return c.empty(); }
	size_t size() const { return N; }

	pointer data() { return c.data(); }
	const_pointer data() const { return c.data(); }

	container_type& get_container() { return c; }
	const container_type& get_container() const	{ return c; }

protected:
	Container c;

};


FC_NAMESPACE_END
